home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / RAVE.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  32.3 KB  |  817 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        RAVE.a
  3. ;
  4. ;    Contains:    Interface for RAVE (Renderer Acceleration Virtual Engine)                            
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__RAVE__') = 'UNDEFINED' THEN
  18. __RAVE__ SET 1
  19.  
  20.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  21.     include 'ConditionalMacros.a'
  22.     ENDIF
  23.  
  24.     IF TARGET_OS_MAC THEN
  25.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  26.     include 'MacTypes.a'
  27.     ENDIF
  28.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  29.     include 'Quickdraw.a'
  30.     ENDIF
  31.     IF &TYPE('__QDOFFSCREEN__') = 'UNDEFINED' THEN
  32.     include 'QDOffscreen.a'
  33.     ENDIF
  34.  
  35.     ENDIF    ; TARGET_OS_MAC
  36.     IF TARGET_OS_WIN32 THEN
  37.     IF &TYPE('RAVE_NO_DIRECTDRAW') = 'UNDEFINED' THEN
  38.     ENDIF
  39.     ENDIF    ; TARGET_OS_WIN32
  40. ; ******************************************************************************
  41. ; *
  42. ; * Platform dependent datatypes: TQAImagePixelType, TQADevice, TQAClip, and TQARect.
  43. ; *
  44. ; ****************************************************************************
  45.  
  46.  
  47. ; typedef long                            TQAImagePixelType
  48. kQAPixel_Alpha1                    EQU        0                    ; 1 bit/pixel alpha 
  49. kQAPixel_RGB16                    EQU        1                    ; 16 bit/pixel, R=14:10, G=9:5, B=4:0 
  50. kQAPixel_ARGB16                    EQU        2                    ; 16 bit/pixel, A=15, R=14:10, G=9:5, B=4:0 
  51. kQAPixel_RGB32                    EQU        3                    ; 32 bit/pixel, R=23:16, G=15:8, B=7:0 
  52. kQAPixel_ARGB32                    EQU        4                    ; 32 bit/pixel, A=31:24, R=23:16, G=15:8, B=7:0 
  53. kQAPixel_CL4                    EQU        5                    ; 4 bit color look up table, always big endian, ie high 4 bits effect left pixel 
  54. kQAPixel_CL8                    EQU        6                    ; 8 bit color look up table 
  55. kQAPixel_RGB16_565                EQU        7                    ; 16 bits/pixel, no alpha, R:5, G:6, B:5 WINDOWS ONLY 
  56. kQAPixel_RGB24                    EQU        8                    ; 24 bits/pixel, no alpha, R:8, G:8, B:8 WINDOWS ONLY 
  57.  
  58. ; typedef long                            TQAColorTableType
  59. kQAColorTable_CL8_RGB32            EQU        0                    ; 256 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 
  60. kQAColorTable_CL4_RGB32            EQU        1                    ; 16 entry, 32 bit/pixel, R=23:16, G=15:8, B=7:0 
  61. ;  Selects target device type 
  62.  
  63. ; typedef long                            TQADeviceType
  64. kQADeviceMemory                    EQU        0                    ; Memory draw context 
  65. kQADeviceGDevice                EQU        1                    ; Macintosh GDevice draw context 
  66. kQADeviceWin32DC                EQU        2                    ; Win32 DC 
  67. kQADeviceDDSurface                EQU        3                    ; Win32 DirectDraw Surface 
  68. ;  Generic memory pixmap device 
  69. TQADeviceMemory            RECORD 0
  70. rowBytes                 ds.l    1                ; offset: $0 (0)        ;  Rowbytes 
  71. pixelType                 ds.l    1                ; offset: $4 (4)        ;  Depth, color space, etc. 
  72. width                     ds.l    1                ; offset: $8 (8)        ;  Width in pixels 
  73. height                     ds.l    1                ; offset: $C (12)        ;  Height in pixels 
  74. baseAddr                 ds.l    1                ; offset: $10 (16)        ;  Base address of pixmap 
  75. sizeof                     EQU *                    ; size:   $14 (20)
  76.                         ENDR
  77. ;  Selects target clip type 
  78.  
  79. ; typedef long                            TQAClipType
  80. kQAClipRgn                        EQU        0                    ; Macintosh clipRgn with serial number 
  81. kQAClipWin32Rgn                    EQU        1                    ; Win32 clip region 
  82. TQARect                    RECORD 0
  83. left                     ds.l    1                ; offset: $0 (0)
  84. right                     ds.l    1                ; offset: $4 (4)
  85. top                         ds.l    1                ; offset: $8 (8)
  86. bottom                     ds.l    1                ; offset: $C (12)
  87. sizeof                     EQU *                    ; size:   $10 (16)
  88.                         ENDR
  89.     IF TARGET_OS_MAC THEN
  90. TQAPlatformDevice        RECORD 0
  91. memoryDevice             ds        TQADeviceMemory ; offset: $0 (0)
  92.                          ORG 0
  93. gDevice                     ds.l    1                ; offset: $0 (0)
  94.                          ORG 20
  95. sizeof                     EQU *                    ; size:   $14 (20)
  96.                         ENDR
  97. TQAPlatformClip            RECORD 0
  98. clipRgn                     ds.l    1                ; offset: $0 (0)
  99. sizeof                     EQU *                    ; size:   $4 (4)
  100.                         ENDR
  101. ; typedef long                             TQADrawNotificationProcRefNum
  102.  
  103. ;  used to unregister your proc 
  104.     ELSEIF TARGET_OS_WIN32 THEN
  105.     ELSE
  106. ;     * Generic platform supports memory device only. TQARect is generic. TQAClip is ???.
  107. ;     
  108.  
  109. TQAPlatformDevice        RECORD 0
  110. memoryDevice             ds        TQADeviceMemory ; offset: $0 (0)
  111. sizeof                     EQU *                    ; size:   $14 (20)
  112.                         ENDR
  113. TQAPlatformClip            RECORD 0
  114. region                     ds.l    1                ; offset: $0 (0)        ;  ??? 
  115. sizeof                     EQU *                    ; size:   $4 (4)
  116.                         ENDR
  117.     ENDIF    ; 
  118. TQADevice                RECORD 0
  119. deviceType                 ds.l    1                ; offset: $0 (0)
  120. device                     ds        TQAPlatformDevice ; offset: $4 (4)
  121. sizeof                     EQU *                    ; size:   $18 (24)
  122.                         ENDR
  123. TQAClip                    RECORD 0
  124. clipType                 ds.l    1                ; offset: $0 (0)
  125. clip                     ds        TQAPlatformClip ; offset: $4 (4)
  126. sizeof                     EQU *                    ; size:   $8 (8)
  127.                         ENDR
  128. ; ******************************************************************************
  129. ; *
  130. ; * Basic data types.
  131. ; *
  132. ; ****************************************************************************
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155. ;  A single triangle element for QADrawTriMesh 
  156. TQAIndexedTriangle        RECORD 0
  157. triangleFlags             ds.l    1                ; offset: $0 (0)        ;  Triangle flags, see kQATriFlags_ 
  158. vertices                 ds.l    3                ; offset: $4 (4)        ;  Indices into a vertex array 
  159. sizeof                     EQU *                    ; size:   $10 (16)
  160.                         ENDR
  161. ;  An image for use as texture or bitmap 
  162. TQAImage                RECORD 0
  163. width                     ds.l    1                ; offset: $0 (0)        ;  Width of pixmap 
  164. height                     ds.l    1                ; offset: $4 (4)        ;  Height of pixmap 
  165. rowBytes                 ds.l    1                ; offset: $8 (8)        ;  Rowbytes of pixmap 
  166. pixmap                     ds.l    1                ; offset: $C (12)        ;  Pixmap 
  167. sizeof                     EQU *                    ; size:   $10 (16)
  168.                         ENDR
  169. ;  Standard error type 
  170.  
  171. ; typedef long                            TQAError
  172. kQANoErr                        EQU        0                    ; No error 
  173. kQAError                        EQU        1                    ; Generic error flag 
  174. kQAOutOfMemory                    EQU        2                    ; Insufficient memory 
  175. kQANotSupported                    EQU        3                    ; Requested feature is not supported 
  176. kQAOutOfDate                    EQU        4                    ; A newer drawing engine was registered 
  177. kQAParamErr                        EQU        5                    ; Error in passed parameters 
  178. kQAGestaltUnknown                EQU        6                    ; Requested gestalt type isn't available 
  179. kQADisplayModeUnsupported        EQU        7                    ; Engine cannot render to the display in its current , 
  180.                                                             ; mode, but could if it were in some other mode 
  181. kQAOutOfVideoMemory                EQU        8                    ; There is not enough VRAM to support the desired context dimensions 
  182. ; ************************************************************************************************
  183. ; *
  184. ; * Vertex data types.
  185. ; *
  186. ; **********************************************************************************************
  187.  
  188. ; * TQAVGouraud is used for Gouraud shading. Each vertex specifies position, color and Z.
  189. ; *
  190. ; * Alpha is always treated as indicating transparency. Drawing engines which don't
  191. ; * support Z-sorted rendering use the back-to-front transparency blending functions
  192. ; * shown below. (ARGBsrc are the source (new) values, ARGBdest are  the destination
  193. ; * (previous) pixel values.)
  194. ; *
  195. ; *        Premultiplied                            Interpolated
  196. ; *
  197. ; *        A = 1 - (1 - Asrc) * (1 - Adest)        A = 1 - (1 - Asrc) * (1 - Adest) 
  198. ; *        R = (1 - Asrc) * Rdest + Rsrc            R = (1 - Asrc) * Rdest + Asrc * Rsrc
  199. ; *        G = (1 - Asrc) * Gdest + Gsrc            G = (1 - Asrc) * Gdest + Asrc * Gsrc
  200. ; *        B = (1 - Asrc) * Bdest + Bsrc            B = (1 - Asrc) * Bdest + Asrc * Bsrc
  201. ; *
  202. ; * Note that the use of other blending modes to implement antialiasing is performed
  203. ; * automatically by the drawing engine when the kQATag_Antialias variable !=
  204. ; * kQAAntiAlias_Fast. The driving software should continue to use the alpha fields
  205. ; * for transparency even when antialiasing is being used (the drawing engine will
  206. ; * resolve the multiple blending requirements as best as it can).
  207. ; *
  208. ; * Drawing engines which perform front-to-back Z-sorted rendering should replace
  209. ; * the blending function shown above with the equivalent front-to-back formula.
  210.  
  211. TQAVGouraud                RECORD 0
  212. x                         ds        Float32            ; offset: $0 (0)        ;  X pixel coordinate, 0.0 <= x < width 
  213. y                         ds        Float32            ; offset: $4 (4)        ;  Y pixel coordinate, 0.0 <= y < height 
  214. z                         ds        Float32            ; offset: $8 (8)        ;  Z coordinate, 0.0 <= z <= 1.0 
  215. invW                     ds        Float32            ; offset: $C (12)        ;  1 / w; required only when kQAPerspectiveZ_On is set 
  216. r                         ds        Float32            ; offset: $10 (16)        ;  Red, 0.0 <= r <= 1.0 
  217. g                         ds        Float32            ; offset: $14 (20)        ;  Green, 0.0 <= g <= 1.0 
  218. b                         ds        Float32            ; offset: $18 (24)        ;  Blue, 0.0 <= b <= 1.0 
  219. a                         ds        Float32            ; offset: $1C (28)        ;  Alpha, 0.0 <= a <= 1.0, 1.0 is opaque 
  220. sizeof                     EQU *                    ; size:   $20 (32)
  221.                         ENDR
  222. ; * TQAVTexture is used for texture mapping. The texture mapping operation
  223. ; * is controlled by the kQATag_TextureOp variable, which is a mask of
  224. ; * kQATextureOp_None/Modulate/Highlight/Decal. Below is pseudo-code for the
  225. ; * texture shading operation:
  226. ; *
  227. ; *        texPix = TextureLookup (uq/q, vq/q);
  228. ; *        if (kQATextureOp_Decal)
  229. ; *        {
  230. ; *            texPix.r = texPix.a * texPix.r + (1 - texPix.a) * r;
  231. ; *            texPix.g = texPix.a * texPix.g + (1 - texPix.a) * g;
  232. ; *            texPix.b = texPix.a * texPix.b + (1 - texPix.a) * b;
  233. ; *            texPix.a = a;
  234. ; *        }
  235. ; *        else
  236. ; *        {
  237. ; *            texPix.a = texPix.a * a;
  238. ; *        }
  239. ; *        if (kQATextureOp_Modulate)
  240. ; *        {
  241. ; *            texPix.r *= kd_r;        // Clamped to prevent overflow
  242. ; *            texPix.g *= kd_g;        // Clamped to prevent overflow
  243. ; *            texPix.b *= kd_b;        // Clamped to prevent overflow
  244. ; *        }
  245. ; *        if (kQATextureOp_Highlight)
  246. ; *        {
  247. ; *            texPix.r += ks_r;        // Clamped to prevent overflow
  248. ; *            texPix.g += ks_g;        // Clamped to prevent overflow
  249. ; *            texPix.b += ks_b;        // Clamped to prevent overflow
  250. ; *        }
  251. ; *
  252. ; * After computation of texPix, transparency blending (as shown
  253. ; * above for TQAVGouraud) is performed.
  254.  
  255. TQAVTexture                RECORD 0
  256. x                         ds        Float32            ; offset: $0 (0)        ;  X pixel coordinate, 0.0 <= x < width 
  257. y                         ds        Float32            ; offset: $4 (4)        ;  Y pixel coordinate, 0.0 <= y < height 
  258. z                         ds        Float32            ; offset: $8 (8)        ;  Z coordinate, 0.0 <= z <= 1.0 
  259. invW                     ds        Float32            ; offset: $C (12)        ;  1 / w (always required) 
  260. ;  rgb are used only when kQATextureOp_Decal is set. a is always required 
  261. r                         ds        Float32            ; offset: $10 (16)        ;  Red, 0.0 <= r <= 1.0 
  262. g                         ds        Float32            ; offset: $14 (20)        ;  Green, 0.0 <= g <= 1.0 
  263. b                         ds        Float32            ; offset: $18 (24)        ;  Blue, 0.0 <= b <= 1.0 
  264. a                         ds        Float32            ; offset: $1C (28)        ;  Alpha, 0.0 <= a <= 1.0, 1.0 is opaque 
  265. ;  uOverW and vOverW are required by all modes 
  266. uOverW                     ds        Float32            ; offset: $20 (32)        ;  u / w 
  267. vOverW                     ds        Float32            ; offset: $24 (36)        ;  v / w 
  268. ;  kd_r/g/b are used only when kQATextureOp_Modulate is set 
  269. kd_r                     ds        Float32            ; offset: $28 (40)        ;  Scale factor for texture red, 0.0 <= kd_r 
  270. kd_g                     ds        Float32            ; offset: $2C (44)        ;  Scale factor for texture green, 0.0 <= kd_g 
  271. kd_b                     ds        Float32            ; offset: $30 (48)        ;  Scale factor for texture blue, 0.0 <= kd_b 
  272. ;  ks_r/g/b are used only when kQATextureOp_Highlight is set 
  273. ks_r                     ds        Float32            ; offset: $34 (52)        ;  Red specular highlight, 0.0 <= ks_r <= 1.0 
  274. ks_g                     ds        Float32            ; offset: $38 (56)        ;  Green specular highlight, 0.0 <= ks_g <= 1.0 
  275. ks_b                     ds        Float32            ; offset: $3C (60)        ;  Blue specular highlight, 0.0 <= ks_b <= 1.0 
  276. sizeof                     EQU *                    ; size:   $40 (64)
  277.                         ENDR
  278. ; ************************************************************************************************
  279. ; *
  280. ; * Constants used for the state variables.
  281. ; *
  282. ; **********************************************************************************************
  283.  
  284. ; * kQATag_xxx is used to select a state variable when calling QASetFloat(), QASetInt(),
  285. ; * QAGetFloat() and QAGetInt(). The kQATag values are split into two separate
  286. ; * enumerated types: TQATagInt and TQATagFloat. TQATagInt is used for the QASet/GetInt()
  287. ; * functions, and TQATagFloat is used for the QASet/GetFloat() functions. (This is so
  288. ; * that a compiler that typechecks enums can flag a float/int tag mismatch during compile.)
  289. ; *
  290. ; * These variables are required by all drawing engines:
  291. ; *        kQATag_ZFunction            (Int)    One of kQAZFunction_xxx
  292. ; *        kQATag_ColorBG_a            (Float)    Background color alpha
  293. ; *        kQATag_ColorBG_r            (Float)    Background color red
  294. ; *        kQATag_ColorBG_g            (Float)    Background color green
  295. ; *        kQATag_ColorBG_b            (Float)    Background color blue
  296. ; *        kQATag_Width                (Float)    Line and point width (pixels)
  297. ; *        kQATag_ZMinOffset            (Float)    Min offset to Z to guarantee visibility (Read only!)
  298. ; *        kQATag_ZMinScale            (Float)    Min scale to Z to guarantee visibility (Read only!)
  299. ; * These variables are used for optional features:
  300. ; *        kQATag_Antialias            (Int)    One of kQAAntiAlias_xxx
  301. ; *        kQATag_Blend                (Int)    One of kQABlend_xxx
  302. ; *        kQATag_PerspectiveZ            (Int)    One of kQAPerspectiveZ_xxx
  303. ; *        kQATag_TextureFilter        (Int)    One of kQATextureFilter_xxx
  304. ; *        kQATag_TextureOp            (Int)    Mask of kQATextureOp_xxx
  305. ; *        kQATag_Texture                (Int)    Pointer to current TQATexture
  306. ; *        kQATag_CSGTag                (Int)    One of kQACSGTag_xxx
  307. ; *        kQATag_CSGEquation            (Int)    32 bit CSG truth table
  308. ; *
  309. ; * These variables are used for OpenGL™ support:
  310. ; *        kQATagGL_DrawBuffer            (Int)    Mask of kQAGL_DrawBuffer_xxx
  311. ; *        kQATagGL_TextureWrapU        (Int)    kQAGL_Clamp or kQAGL_Repeat
  312. ; *        kQATagGL_TextureWrapV        (Int)    kQAGL_Clamp or kQAGL_Repeat
  313. ; *        kQATagGL_TextureMagFilter    (Int)    kQAGL_Nearest or kQAGL_Linear
  314. ; *        kQATagGL_TextureMinFilter    (Int)    kQAGL_Nearest, etc.
  315. ; *        kQATagGL_ScissorXMin        (Int)    Minimum X value for scissor rectangle
  316. ; *        kQATagGL_ScissorYMin        (Int)    Minimum Y value for scissor rectangle
  317. ; *        kQATagGL_ScissorXMax        (Int)    Maximum X value for scissor rectangle
  318. ; *        kQATagGL_ScissorYMax        (Int)    Maximum Y value for scissor rectangle
  319. ; *        kQATagGL_BlendSrc            (Int)    Source blending operation
  320. ; *        kQATagGL_BlendDst            (Int)    Destination blending operation
  321. ; *        kQATagGL_LinePattern        (Int)    Line rasterization pattern
  322. ; *        kQATagGL_AreaPattern0        (Int)    First of 32 area pattern registers
  323. ; *        kQATagGL_AreaPattern31        (Int)    Last of 32 area pattern registers
  324. ; *        kQATagGL_DepthBG            (Float)    Background Z
  325. ; *        kQATagGL_TextureBorder_a    (Float)    Texture border color alpha
  326. ; *        kQATagGL_TextureBorder_r    (Float)    Texture border color red
  327. ; *        kQATagGL_TextureBorder_g    (Float)    Texture border color green
  328. ; *        kQATagGL_TextureBorder_b    (Float)    Texture border color blue
  329. ; *
  330. ; * Tags >= kQATag_EngineSpecific_Minimum may be assigned by the vendor for use as
  331. ; * engine-specific variables. NOTE: These should be used only in exceptional circumstances,
  332. ; * as functions performed by these variables won't be generally accessible. All other tag
  333. ; * values are reserved.
  334. ; *
  335. ; *        kQATag_EngineSpecific_Minimum    Minimum tag value for drawing-engine specific variables
  336.  
  337.  
  338. ; typedef long                            TQATagInt
  339. kQATag_ZFunction                EQU        0
  340. kQATag_Antialias                EQU        8
  341. kQATag_Blend                    EQU        9
  342. kQATag_PerspectiveZ                EQU        10
  343. kQATag_TextureFilter            EQU        11
  344. kQATag_TextureOp                EQU        12
  345. kQATag_CSGTag                    EQU        14
  346. kQATag_CSGEquation                EQU        15
  347. kQATag_BufferComposite            EQU        16
  348. kQATagGL_DrawBuffer                EQU        100
  349. kQATagGL_TextureWrapU            EQU        101
  350. kQATagGL_TextureWrapV            EQU        102
  351. kQATagGL_TextureMagFilter        EQU        103
  352. kQATagGL_TextureMinFilter        EQU        104
  353. kQATagGL_ScissorXMin            EQU        105
  354. kQATagGL_ScissorYMin            EQU        106
  355. kQATagGL_ScissorXMax            EQU        107
  356. kQATagGL_ScissorYMax            EQU        108
  357. kQATagGL_BlendSrc                EQU        109
  358. kQATagGL_BlendDst                EQU        110
  359. kQATagGL_LinePattern            EQU        111
  360. kQATagGL_AreaPattern0            EQU        117                    ; ...1-30 
  361. kQATagGL_AreaPattern31            EQU        148
  362. kQATag_EngineSpecific_Minimum    EQU        1000
  363.  
  364. ; typedef long                            TQATagPtr
  365. kQATag_Texture                    EQU        13
  366.  
  367. ; typedef long                            TQATagFloat
  368. kQATag_ColorBG_a                EQU        1
  369. kQATag_ColorBG_r                EQU        2
  370. kQATag_ColorBG_g                EQU        3
  371. kQATag_ColorBG_b                EQU        4
  372. kQATag_Width                    EQU        5
  373. kQATag_ZMinOffset                EQU        6
  374. kQATag_ZMinScale                EQU        7
  375. kQATagGL_DepthBG                EQU        112
  376. kQATagGL_TextureBorder_a        EQU        113
  377. kQATagGL_TextureBorder_r        EQU        114
  378. kQATagGL_TextureBorder_g        EQU        115
  379. kQATagGL_TextureBorder_b        EQU        116
  380. ;  kQATag_ZFunction 
  381.  
  382. kQAZFunction_None                EQU        0                    ; Z is neither tested nor written (same as no Z buffer) 
  383. kQAZFunction_LT                    EQU        1                    ; Znew < Zbuffer is visible 
  384. kQAZFunction_EQ                    EQU        2                    ; OpenGL Only: Znew == Zbuffer is visible 
  385. kQAZFunction_LE                    EQU        3                    ; OpenGL Only: Znew <= Zbuffer is visible 
  386. kQAZFunction_GT                    EQU        4                    ; OpenGL Only: Znew > Zbuffer is visible 
  387. kQAZFunction_NE                    EQU        5                    ; OpenGL Only: Znew != Zbuffer is visible 
  388. kQAZFunction_GE                    EQU        6                    ; OpenGL Only: Znew >= Zbuffer is visible 
  389. kQAZFunction_True                EQU        7                    ; Znew is always visible 
  390. ;  kQATag_Width 
  391. ;  kQATag_Antialias 
  392.  
  393. kQAAntiAlias_Off                EQU        0
  394. kQAAntiAlias_Fast                EQU        1
  395. kQAAntiAlias_Mid                EQU        2
  396. kQAAntiAlias_Best                EQU        3
  397. ;  kQATag_Blend 
  398.  
  399. kQABlend_PreMultiply            EQU        0
  400. kQABlend_Interpolate            EQU        1
  401. kQABlend_OpenGL                    EQU        2
  402. ;  kQATag_BufferComposite 
  403.  
  404. kQABufferComposite_None            EQU        0                    ; Default: New pixels overwrite initial buffer contents 
  405. kQABufferComposite_PreMultiply    EQU        1                    ; New pixels are blended with initial buffer contents via PreMultiply 
  406. kQABufferComposite_Interpolate    EQU        2                    ; New pixels are blended with initial buffer contents via Interpolate 
  407. ;  kQATag_PerspectiveZ 
  408.  
  409. kQAPerspectiveZ_Off                EQU        0                    ; Use Z for hidden surface removal 
  410. kQAPerspectiveZ_On                EQU        1                    ; Use InvW for hidden surface removal 
  411. ;  kQATag_TextureFilter 
  412.  
  413.                                                             ; suggested meanings of these values 
  414. kQATextureFilter_Fast            EQU        0                    ; No filtering, pick nearest 
  415. kQATextureFilter_Mid            EQU        1                    ; Fastest method that does some filtering 
  416. kQATextureFilter_Best            EQU        2                    ; Highest quality renderer can do 
  417. ;  kQATag_TextureOp (mask of one or more) 
  418.  
  419. kQATextureOp_None                EQU        0                    ; Default texture mapping mode 
  420. kQATextureOp_Modulate            EQU        $01                    ; Modulate texture color with kd_r/g/b 
  421. kQATextureOp_Highlight            EQU        $02                    ; Add highlight value ks_r/g/b 
  422. kQATextureOp_Decal                EQU        $04                    ; When texture alpha == 0, use rgb instead 
  423. kQATextureOp_Shrink                EQU        $08                    ; This is a non-wrapping texture, so the ??? 
  424. ;  kQATag_CSGTag 
  425.  
  426. kQACSGTag_0                        EQU        0                    ; Submitted tris have CSG ID 0 
  427. kQACSGTag_1                        EQU        1                    ; Submitted tris have CSG ID 1 
  428. kQACSGTag_2                        EQU        2                    ; Submitted tris have CSG ID 2 
  429. kQACSGTag_3                        EQU        3                    ; Submitted tris have CSG ID 3 
  430. kQACSGTag_4                        EQU        4                    ; Submitted tris have CSG ID 4 
  431. ;  kQATagGL_TextureWrapU/V 
  432.  
  433. kQAGL_Repeat                    EQU        0
  434. kQAGL_Clamp                        EQU        1
  435. ;  kQATagGL_BlendSrc 
  436.  
  437. kQAGL_SourceBlend_XXX            EQU        0
  438. ;  kQATagGL_BlendDst 
  439.  
  440. kQAGL_DestBlend_XXX                EQU        0
  441. ;  kQATagGL_DrawBuffer (mask of one or more) 
  442.  
  443. kQAGL_DrawBuffer_None            EQU        0
  444. kQAGL_DrawBuffer_FrontLeft        EQU        $01
  445. kQAGL_DrawBuffer_FrontRight        EQU        $02
  446. kQAGL_DrawBuffer_BackLeft        EQU        $04
  447. kQAGL_DrawBuffer_BackRight        EQU        $08
  448. kQAGL_DrawBuffer_Front            EQU        $03
  449. kQAGL_DrawBuffer_Back            EQU        $0C
  450. ; ************************************************************************************************
  451. ; *
  452. ; * Constants used as function parameters.
  453. ; *
  454. ; **********************************************************************************************
  455.  
  456. ; * TQAVertexMode is a parameter to QADrawVGouraud() and QADrawVTexture() that specifies how
  457. ; * to interpret and draw the vertex array.
  458.  
  459.  
  460. ; typedef long                            TQAVertexMode
  461. kQAVertexMode_Point                EQU        0                    ; Draw nVertices points 
  462. kQAVertexMode_Line                EQU        1                    ; Draw nVertices/2 line segments 
  463. kQAVertexMode_Polyline            EQU        2                    ; Draw nVertices-1 connected line segments 
  464. kQAVertexMode_Tri                EQU        3                    ; Draw nVertices/3 triangles 
  465. kQAVertexMode_Strip                EQU        4                    ; Draw nVertices-2 triangles as a strip 
  466. kQAVertexMode_Fan                EQU        5                    ; Draw nVertices-2 triangles as a fan from v0 
  467. kQAVertexMode_NumModes            EQU        6
  468. ; * TQAGestaltSelector is a parameter to QAEngineGestalt(). It selects which gestalt
  469. ; * parameter will be copied into 'response'.
  470.  
  471.  
  472. ; typedef long                            TQAGestaltSelector
  473. kQAGestalt_OptionalFeatures        EQU        0                    ; Mask of one or more kQAOptional_xxx 
  474. kQAGestalt_FastFeatures            EQU        1                    ; Mask of one or more kQAFast_xxx 
  475. kQAGestalt_VendorID                EQU        2                    ; Vendor ID 
  476. kQAGestalt_EngineID                EQU        3                    ; Engine ID 
  477. kQAGestalt_Revision                EQU        4                    ; Revision number of this engine 
  478. kQAGestalt_ASCIINameLength        EQU        5                    ; strlen (asciiName) 
  479. kQAGestalt_ASCIIName            EQU        6                    ; Causes strcpy (response, asciiName) 
  480. kQAGestalt_TextureMemory        EQU        7                    ; amount of texture RAM currently available 
  481. kQAGestalt_FastTextureMemory    EQU        8                    ; amount of texture RAM currently available 
  482. kQAGestalt_NumSelectors            EQU        9
  483. ; * TQAMethodSelector is a parameter to QASetNoticeMethod to select the notice method
  484.  
  485.  
  486. ; typedef long                            TQAMethodSelector
  487. kQAMethod_RenderCompletion        EQU        0                    ; Called when rendering has completed and buffers swapped 
  488. kQAMethod_DisplayModeChanged    EQU        1                    ; Called when a display mode has changed 
  489. kQAMethod_ReloadTextures        EQU        2                    ; Called when texture memory has been invalidated 
  490. kQAMethod_BufferInitialize        EQU        3                    ; Called when a buffer needs to be initialized 
  491. kQAMethod_BufferComposite        EQU        4                    ; Called when rendering is finished and its safe to composite 
  492. kQAMethod_NumSelectors            EQU        5
  493. ; * kQATriFlags_xxx are ORed together to generate the 'flags' parameter
  494. ; * to QADrawTriGouraud() and QADrawTriTexture().
  495.  
  496.  
  497. kQATriFlags_None                EQU        0                    ; No flags (triangle is front-facing or don't care) 
  498. kQATriFlags_Backfacing            EQU        $01                    ; Triangle is back-facing 
  499. ; * kQATexture_xxx are ORed together to generate the 'flags' parameter to QATextureNew().
  500.  
  501.  
  502. kQATexture_None                    EQU        0                    ; No flags 
  503. kQATexture_Lock                    EQU        $01                    ; Don't swap this texture out 
  504. kQATexture_Mipmap                EQU        $02                    ; This texture is mipmapped 
  505. kQATexture_NoCompression        EQU        $04                    ; Do not compress this texture 
  506. kQATexture_HighCompression        EQU        $08                    ; Compress texture, even if it takes a while 
  507. ; * kQABitmap_xxx are ORed together to generate the 'flags' parameter to QABitmapNew().
  508.  
  509.  
  510. kQABitmap_None                    EQU        0                    ; No flags 
  511. kQABitmap_Lock                    EQU        $02                    ; Don't swap this bitmap out 
  512. kQABitmap_NoCompression            EQU        $04                    ; Do not compress this bitmap 
  513. kQABitmap_HighCompression        EQU        $08                    ; Compress bitmap, even if it takes a while 
  514. ; * kQAContext_xxx are ORed together to generate the 'flags' parameter for QADrawContextNew().
  515.  
  516.  
  517. kQAContext_None                    EQU        0                    ; No flags 
  518. kQAContext_NoZBuffer            EQU        $01                    ; No hidden surface removal 
  519. kQAContext_DeepZ                EQU        $02                    ; Hidden surface precision >= 24 bits 
  520. kQAContext_DoubleBuffer            EQU        $04                    ; Double buffered window 
  521. kQAContext_Cache                EQU        $08                    ; This is a cache context 
  522. kQAContext_NoDither                EQU        $10                    ; No dithering, straight color banding 
  523. ; * kQAOptional_xxx are ORed together to generate the kQAGestalt_OptionalFeatures response
  524. ; * from QAEngineGestalt().
  525.  
  526.  
  527. kQAOptional_None                EQU        0                    ; No optional features 
  528. kQAOptional_DeepZ                EQU        $01                    ; Hidden surface precision >= 24 bits 
  529. kQAOptional_Texture                EQU        $02                    ; Texture mapping 
  530. kQAOptional_TextureHQ            EQU        $04                    ; High quality texture (tri-linear mip or better) 
  531. kQAOptional_TextureColor        EQU        $08                    ; Full color modulation and highlight of textures 
  532. kQAOptional_Blend                EQU        $10                    ; Transparency blending of RGB 
  533. kQAOptional_BlendAlpha            EQU        $20                    ; Transparency blending includes alpha channel 
  534. kQAOptional_Antialias            EQU        $40                    ; Antialiased rendering 
  535. kQAOptional_ZSorted                EQU        $80                    ; Z sorted rendering (for transparency, etc.) 
  536. kQAOptional_PerspectiveZ        EQU        $0100                ; Hidden surface removal using InvW instead of Z 
  537. kQAOptional_OpenGL                EQU        $0200                ; Extended rasterization features for OpenGL™ 
  538. kQAOptional_NoClear                EQU        $0400                ; This drawing engine doesn't clear before drawing 
  539. kQAOptional_CSG                    EQU        $0800                ; kQATag_CSGxxx are implemented 
  540. kQAOptional_BoundToDevice        EQU        $1000                ; This engine is tightly bound to GDevice 
  541. kQAOptional_CL4                    EQU        $2000                ; This engine suports kQAPixel_CL4 
  542. kQAOptional_CL8                    EQU        $4000                ; This engine suports kQAPixel_CL8 
  543. kQAOptional_BufferComposite        EQU        $8000                ; This engine can composite with initial buffer contents 
  544. kQAOptional_NoDither            EQU        $00010000            ; This engine can draw with no dithering 
  545. ; * kQAFast_xxx are ORed together to generate the kQAGestalt_FastFeatures response
  546. ; * from QAEngineGestalt().
  547.  
  548.  
  549. kQAFast_None                    EQU        0                    ; No accelerated features 
  550. kQAFast_Line                    EQU        $01                    ; Line drawing 
  551. kQAFast_Gouraud                    EQU        $02                    ; Gouraud shaded triangles 
  552. kQAFast_Texture                    EQU        $04                    ; Texture mapped triangles 
  553. kQAFast_TextureHQ                EQU        $08                    ; High quality texture (tri-linear mip or better) 
  554. kQAFast_Blend                    EQU        $10                    ; Transparency blending 
  555. kQAFast_Antialiasing            EQU        $20                    ; Antialiased rendering 
  556. kQAFast_ZSorted                    EQU        $40                    ; Z sorted rendering of non-opaque objects 
  557. kQAFast_CL4                        EQU        $80                    ; This engine accelerates kQAPixel_CL4 
  558. kQAFast_CL8                        EQU        $0100                ; This engine accelerates kQAPixel_CL8 
  559.  
  560.  
  561.  
  562. ; ********************************************************************
  563. ; * TQAVersion sets the TQADrawContext 'version' field. It is set by
  564. ; * the manager to indicate the version of the TQADrawContext structure.
  565. ; ******************************************************************
  566.  
  567.  
  568. ; typedef long                            TQAVersion
  569. kQAVersion_Prerelease            EQU        0
  570. kQAVersion_1_0                    EQU        1
  571. kQAVersion_1_0_5                EQU        2                    ; Added tri mesh functions, color tables 
  572. kQAVersion_1_5                    EQU        3                    ; Added call backs, texture compression, and new error return code 
  573.  
  574.  
  575. ; ***********************************************************************
  576. ; * TQADrawContext structure holds method pointers.
  577. ; * This is a forward refrence. The structure is defined later.
  578. ; *********************************************************************
  579.  
  580.  
  581.  
  582. ; ************************************************************************************************
  583. ; *
  584. ; * Typedefs of draw method functions provided by the drawing engine. One function pointer
  585. ; * for each of these function types in stored in the TQADrawContext public data structure.
  586. ; *
  587. ; * These functions should be accessed through the QA<function>(context,...) macros,
  588. ; * defined above.
  589. ; *
  590. ; **********************************************************************************************
  591.  
  592. TQANoticeMethod            RECORD 0
  593. standardNoticeMethod     ds.l    1                ; offset: $0 (0)        ;  Used for non-buffer related methods 
  594.                          ORG 0
  595. bufferNoticeMethod         ds.l    1                ; offset: $0 (0)        ;  Used for buffer handling methods 
  596. sizeof                     EQU *                    ; size:   $4 (4)
  597.                         ENDR
  598. ; ************************************************************************************************
  599. ; *
  600. ; * Public TQADrawContext structure. This contains function pointers for the chosen
  601. ; * drawing engine.
  602. ; *
  603. ; **********************************************************************************************
  604.  
  605. TQADrawContext            RECORD 0
  606. drawPrivate                 ds.l    1                ; offset: $0 (0)        ;  Engine's private data for this context 
  607. version                     ds.l    1                ; offset: $4 (4)        ;  Version number 
  608. setFloat                 ds.l    1                ; offset: $8 (8)        ;  Method: Set a float state variable 
  609. setInt                     ds.l    1                ; offset: $C (12)        ;  Method: Set an unsigned long state variable 
  610. setPtr                     ds.l    1                ; offset: $10 (16)        ;  Method: Set an unsigned long state variable 
  611. getFloat                 ds.l    1                ; offset: $14 (20)        ;  Method: Get a float state variable 
  612. getInt                     ds.l    1                ; offset: $18 (24)        ;  Method: Get an unsigned long state variable 
  613. getPtr                     ds.l    1                ; offset: $1C (28)        ;  Method: Get an pointer state variable 
  614. drawPoint                 ds.l    1                ; offset: $20 (32)        ;  Method: Draw a point 
  615. drawLine                 ds.l    1                ; offset: $24 (36)        ;  Method: Draw a line 
  616. drawTriGouraud             ds.l    1                ; offset: $28 (40)        ;  Method: Draw a Gouraud shaded triangle 
  617. drawTriTexture             ds.l    1                ; offset: $2C (44)        ;  Method: Draw a texture mapped triangle 
  618. drawVGouraud             ds.l    1                ; offset: $30 (48)        ;  Method: Draw Gouraud vertices 
  619. drawVTexture             ds.l    1                ; offset: $34 (52)        ;  Method: Draw texture vertices 
  620. drawBitmap                 ds.l    1                ; offset: $38 (56)        ;  Method: Draw a bitmap 
  621. renderStart                 ds.l    1                ; offset: $3C (60)        ;  Method: Initialize for rendering 
  622. renderEnd                 ds.l    1                ; offset: $40 (64)        ;  Method: Complete rendering and display 
  623. renderAbort                 ds.l    1                ; offset: $44 (68)        ;  Method: Abort any outstanding rendering (blocking) 
  624. flush                     ds.l    1                ; offset: $48 (72)        ;  Method: Start render of any queued commands (non-blocking) 
  625. sync                     ds.l    1                ; offset: $4C (76)        ;  Method: Wait for completion of all rendering (blocking) 
  626. submitVerticesGouraud     ds.l    1                ; offset: $50 (80)        ;  Method: Submit Gouraud vertices for trimesh 
  627. submitVerticesTexture     ds.l    1                ; offset: $54 (84)        ;  Method: Submit Texture vertices for trimesh 
  628. drawTriMeshGouraud         ds.l    1                ; offset: $58 (88)        ;  Method: Draw a Gouraud triangle mesh 
  629. drawTriMeshTexture         ds.l    1                ; offset: $5C (92)        ;  Method: Draw a Texture triangle mesh 
  630. setNoticeMethod             ds.l    1                ; offset: $60 (96)        ;  Method: Set a notice method 
  631. getNoticeMethod             ds.l    1                ; offset: $64 (100)        ;  Method: Get a notice method 
  632. sizeof                     EQU *                    ; size:   $68 (104)
  633.                         ENDR
  634. ; ************************************************************************************************
  635. ; *
  636. ; * Acceleration manager function prototypes.
  637. ; *
  638. ; **********************************************************************************************
  639.  
  640. ;
  641. ; extern TQAError QADrawContextNew(const TQADevice *device, const TQARect *rect, const TQAClip *clip, const TQAEngine *engine, unsigned long flags, TQADrawContext **newDrawContext)
  642. ;
  643.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  644.         IMPORT_CFM_FUNCTION QADrawContextNew
  645.     ENDIF
  646.  
  647. ;
  648. ; extern void QADrawContextDelete(TQADrawContext *drawContext)
  649. ;
  650.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  651.         IMPORT_CFM_FUNCTION QADrawContextDelete
  652.     ENDIF
  653.  
  654. ;
  655. ; extern TQAError QAColorTableNew(const TQAEngine *engine, TQAColorTableType tableType, void *pixelData, long transparentIndexFlag, TQAColorTable **newTable)
  656. ;
  657.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  658.         IMPORT_CFM_FUNCTION QAColorTableNew
  659.     ENDIF
  660.  
  661. ;
  662. ; extern void QAColorTableDelete(const TQAEngine *engine, TQAColorTable *colorTable)
  663. ;
  664.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  665.         IMPORT_CFM_FUNCTION QAColorTableDelete
  666.     ENDIF
  667.  
  668. ;
  669. ; extern TQAError QATextureNew(const TQAEngine *engine, unsigned long flags, TQAImagePixelType pixelType, const TQAImage images[2147483647], TQATexture **newTexture)
  670. ;
  671.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  672.         IMPORT_CFM_FUNCTION QATextureNew
  673.     ENDIF
  674.  
  675. ;
  676. ; extern TQAError QATextureDetach(const TQAEngine *engine, TQATexture *texture)
  677. ;
  678.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  679.         IMPORT_CFM_FUNCTION QATextureDetach
  680.     ENDIF
  681.  
  682. ;
  683. ; extern void QATextureDelete(const TQAEngine *engine, TQATexture *texture)
  684. ;
  685.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  686.         IMPORT_CFM_FUNCTION QATextureDelete
  687.     ENDIF
  688.  
  689. ;
  690. ; extern TQAError QATextureBindColorTable(const TQAEngine *engine, TQATexture *texture, TQAColorTable *colorTable)
  691. ;
  692.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  693.         IMPORT_CFM_FUNCTION QATextureBindColorTable
  694.     ENDIF
  695.  
  696. ;
  697. ; extern TQAError QABitmapNew(const TQAEngine *engine, unsigned long flags, TQAImagePixelType pixelType, const TQAImage *image, TQABitmap **newBitmap)
  698. ;
  699.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  700.         IMPORT_CFM_FUNCTION QABitmapNew
  701.     ENDIF
  702.  
  703. ;
  704. ; extern TQAError QABitmapDetach(const TQAEngine *engine, TQABitmap *bitmap)
  705. ;
  706.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  707.         IMPORT_CFM_FUNCTION QABitmapDetach
  708.     ENDIF
  709.  
  710. ;
  711. ; extern void QABitmapDelete(const TQAEngine *engine, TQABitmap *bitmap)
  712. ;
  713.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  714.         IMPORT_CFM_FUNCTION QABitmapDelete
  715.     ENDIF
  716.  
  717. ;
  718. ; extern TQAError QABitmapBindColorTable(const TQAEngine *engine, TQABitmap *bitmap, TQAColorTable *colorTable)
  719. ;
  720.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  721.         IMPORT_CFM_FUNCTION QABitmapBindColorTable
  722.     ENDIF
  723.  
  724. ;
  725. ; extern TQAEngine *QADeviceGetFirstEngine(const TQADevice *device)
  726. ;
  727.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  728.         IMPORT_CFM_FUNCTION QADeviceGetFirstEngine
  729.     ENDIF
  730.  
  731. ;
  732. ; extern TQAEngine *QADeviceGetNextEngine(const TQADevice *device, const TQAEngine *currentEngine)
  733. ;
  734.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  735.         IMPORT_CFM_FUNCTION QADeviceGetNextEngine
  736.     ENDIF
  737.  
  738. ;
  739. ; extern TQAError QAEngineCheckDevice(const TQAEngine *engine, const TQADevice *device)
  740. ;
  741.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  742.         IMPORT_CFM_FUNCTION QAEngineCheckDevice
  743.     ENDIF
  744.  
  745. ;
  746. ; extern TQAError QAEngineGestalt(const TQAEngine *engine, TQAGestaltSelector selector, void *response)
  747. ;
  748.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  749.         IMPORT_CFM_FUNCTION QAEngineGestalt
  750.     ENDIF
  751.  
  752. ;
  753. ; extern TQAError QAEngineEnable(long vendorID, long engineID)
  754. ;
  755.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  756.         IMPORT_CFM_FUNCTION QAEngineEnable
  757.     ENDIF
  758.  
  759. ;
  760. ; extern TQAError QAEngineDisable(long vendorID, long engineID)
  761. ;
  762.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  763.         IMPORT_CFM_FUNCTION QAEngineDisable
  764.     ENDIF
  765.  
  766.  
  767.     IF TARGET_OS_MAC THEN
  768. ;
  769. ; extern TQAError QARegisterDrawNotificationProc(Rect *globalRect, TQADrawNotificationProcPtr proc, long refCon, TQADrawNotificationProcRefNum *refNum)
  770. ;
  771.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  772.         IMPORT_CFM_FUNCTION QARegisterDrawNotificationProc
  773.     ENDIF
  774.  
  775. ;
  776. ; extern TQAError QAUnregisterDrawNotificationProc(TQADrawNotificationProcRefNum refNum)
  777. ;
  778.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  779.         IMPORT_CFM_FUNCTION QAUnregisterDrawNotificationProc
  780.     ENDIF
  781.  
  782.     ENDIF    ; TARGET_OS_MAC
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.     ENDIF ; __RAVE__ 
  790.  
  791.